{% extends 'layout.html' %}
{% block content %}
    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <th>序号</th>
            <th>姓名</th>
            <th>密码</th>
        </tr>
        </thead>
        <tbody>

        {% for foo in list %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>{{ foo.user }}</td>
                <td>{{ foo.password }}</td>
            </tr>

        {% endfor %}


        </tbody>
    </table>
    <nav aria-label="Page navigation">
        <ul class="pagination">

            <li><a href="?page=1">首页</a></li>
            {% if page == 1 %}
                <li class="disabled">
                    <a href="?page={{ pagep }}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            {% else %}
                <li>
                    <a href="?page={{ pagep }}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            {% endif %}

            {% for count in amount %}
                {% if page == count %}
                    <li class="active"><a href="?page={{ count }}">{{ count }}</a></li>
                {% else %}
                    <li><a href="?page={{ count }}">{{ count }}</a></li>
                {% endif %}

            {% endfor %}

            {% if page == count %}
                <li class="disabled">
                    <a href="?page={{ pagen }}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            {% else %}
                <li>
                    <a href="?page={{ pagen }}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            {% endif %}

            <li><a href="?page={{ count }}">尾页</a></li>
        </ul>
    </nav>

{% endblock %}